package com.you.swagger.controller;

import com.you.swagger.service.IUserService;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;

/**
 * @Description
 * @Author yough
 * @Version V1.0.0
 * @Since 1.0
 * @Date 2021/1/12
 */
public class ProxyUser {

    public Object getProxy() {
        Object object = Proxy.newProxyInstance(this.getClass().getClassLoader(), new Class[]{IUserInterface.class},
                new InvocationHandler() {
                    @Override
                    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
                        System.out.println("----------test--------");
                        return null;
                    }
                });
        return object;
    }
}
